package com.hmall.order.config;

import com.hmall.order.interceptor.UserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置
 */
@Configuration
public class MVCConfig implements WebMvcConfigurer {
    // ctrl o  重写方法
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
         //                      拦截器                     拦截路径
        registry.addInterceptor(new UserInterceptor()).addPathPatterns("/**");
    }
}
